package com.ruoyi.product.service.impl;

import java.util.List;

import com.ruoyi.product.domain.vo.CateVo;
import com.ruoyi.product.domain.vo.ProCatVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.product.mapper.CategoriesMapper;
import com.ruoyi.product.domain.Categories;
import com.ruoyi.product.service.ICategoriesService;

/**
 * 商品类别Service业务层处理
 *
 * @author ruoyi
 * @date 2024-12-07
 */
@Service
public class CategoriesServiceImpl implements ICategoriesService
{
    @Autowired
    private CategoriesMapper categoriesMapper;

    /**
     * 查询商品类别
     *
     * @param id 商品类别主键
     * @return 商品类别
     */
    @Override
    public Categories selectCategoriesById(Long id)
    {
        return categoriesMapper.selectCategoriesById(id);
    }

    /**
     * 查询商品类别列表
     *
     * @param categories 商品类别
     * @return 商品类别
     */
    @Override
    public List<CateVo> selectCategoriesList(CateVo categories)
    {
        return categoriesMapper.selectCategoriesList(categories);
    }

    @Override
    public List<CateVo> selectUserCategoriesList(CateVo categories) {
        return categoriesMapper.selectUserCategoriesList(categories);
    }

    /**
     * 新增商品类别
     *
     * @param categories 商品类别
     * @return 结果
     */
    @Override
    public int insertCategories(Categories categories)
    {
        return categoriesMapper.insertCategories(categories);
    }

    /**
     * 修改商品类别
     *
     * @param categories 商品类别
     * @return 结果
     */
    @Override
    public int updateCategories(Categories categories)
    {
        return categoriesMapper.updateCategories(categories);
    }

    /**
     * 批量删除商品类别
     *
     * @param ids 需要删除的商品类别主键
     * @return 结果
     */
    @Override
    public int deleteCategoriesByIds(Long[] ids)
    {
        return categoriesMapper.deleteCategoriesByIds(ids);
    }

    /**
     * 删除商品类别信息
     *
     * @param id 商品类别主键
     * @return 结果
     */
    @Override
    public int deleteCategoriesById(Long id)
    {
        return categoriesMapper.deleteCategoriesById(id);
    }

    @Override
    public List<String> selectCName() {
        return categoriesMapper.selectCName();
    }

    @Override
    public Long selectCId(String cName) {
        return categoriesMapper.selectCId(cName);
    }


}
